<?xml version="1.0" encoding="UTF-8"?>
<!--
UML to Django

@author: Goffer Looney (glooney)
@doc: http://code.google.com/p/uml-to-django/
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
								xmlns:UML="org.omg.xmi.namespace.UML"
								xmlns:xmidj="xmi2dj"
								xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:output method="text" omit-xml-declaration="yes" indent="no" />

<xsl:key name="classes" match="//UML:Class" use="@xmi.id" />

<xsl:template match="/">
<xml:text># Auto generated from an XMI file
# Do not edit this file
# Edit admin_custom.py instead
from models import *
from admin_generic import *
from admin_custom import *
from django.contrib import admin
</xml:text>

#
<xsl:for-each select="//UML:Class[@name and @name != '' and substring(@name,1,1) != '_']">
	<xsl:text>admin.site.register(</xsl:text><xsl:value-of select="translate(@name, ' ', '_')" />, <xsl:value-of select="translate(@name, ' ', '_')" /><xsl:text>Admin)
</xsl:text>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>